lines sim_delete_player_from_lines(match_index, guy_index,0); } } // install a valid defensive line into the checking line get_line(match_index, LINE_CHECKING) -> playerid[3] = get_line(match_index, LINE_SCORING1) -> playerid[3]; get_line(match_index, LINE_CHECKING) -> playerid[4] = get_line(match_index, LINE_SCORING1) -> playerid[4]; // mark games played for (i = 0; i < get_num_players(match_index); i++) { if (player_on_ice(match_index, i)) { played_in_game[match_index][i] = TRUE;; } } played_in_game[match_index][(int)get_team_ptr(match_index)->starting_goalie] = TRUE; } /********************************************************************** * sim_delete_player_from_lines **********************************************************************/ void sim_delete_player_from_lines(int match_index, int guy_index, int copyLines) { delete_player_from_lines(guy_index, get_team_ptr(match_index), sim_players, 1); // If we are not allowing line changes then copy line 1 to the others // We only want to do this if we are called during penalties because // our real lines have been saved off then. If called from determine_injury // don't copy the lines. if (copyLines) { if (match_index == HOME_TEAM) { if (!g_line_change_home_flag) { copy_line_1(HOME_TEAM); } } else if (!g_line_change_away_flag) { copy_line_1(HOME_TEAM); } } } /********************************************************************** * sim_remove_line_player * WARNING - special function called by routines in common.c * when inserting a player into a line **********************************************************************/ //void sim_remove_line_player(TEAM_INFO *t_info, int player_id) //{ // int match_index; // // if (t_info == get_team_ptr(HOME_TEAM)) { // match_index = HOME_TEAM; // } // else { // match_index = AWAY_TEAM; // } // // set_player_status(match_index, player_id, STATUS_ON_BENCH); //} ///********************************************************************** //* sim_insert_line_player //* WARNING - special function called by routines in common.c //* when deleting a player from a line //**********************************************************************/ //void sim_insert_line_player(TEAM_INFO *t_info, int new_player) //{ // int match_index; // // if (t_info == get_team_ptr(HOME_TEAM)) { // match_index = HOME_TEAM; // } // else { // match_index = AWAY_TEAM; // } // // set_player_status(match_index, new_player, STATUS_ON_ICE); // played_in_game[match_index][new_player] = TRUE; //} /********************************************************************* * determine_hot_players *********************************************************************/ void determine_hot_players(int match_index, int team, int weWon) { int i,j; int player_team_id; RAND_LIST slots_replaced[MAX_HOT_PLAYERS]; RAND_LIST sorted_players[PLAYERS_TEAM]; // init the slots replaced array for (i=0; i= 3 || match_sh_goals[match_index][sorted_players[i].index]) { // guy qualified, install him install_guy_on_hot_list(team, sorted_players[i].index, slots_replaced, sim_team_stats); } i++; } // check goalies for (j=0; j= 3*g_period_length) { if (match_goalie_goals_against[match_index][j] == 0) { if (i < MAX_HOT_PLAYERS) { install_guy_on_hot_list(team, j, slots_replaced, sim_team_stats); i++; } } } // check 60+ saves if (match_goalie_shots_on[match_index][j] - match_goalie_goals_against[match_index][j] >= 60) { if (i < MAX_HOT_PLAYERS) { install_guy_on_hot_list(team, j, slots_replaced, sim_team_stats); i++; } } // check 30+ saves and < 2 goals against if ((match_goalie_shots_on[match_index][j] - match_goalie_goals_against[match_index][j] >= 30) && match_goalie_goals_against[match_index][j] < 2) { if (i < MAX_HOT_PLAYERS) { install_guy_on_hot_list(team, j, slots_replaced, sim_team_stats); i++; } } } } Debug_print(OFF,"Hot: "); for (i=0; i= visit_score) { cur_team = home; cur_match_index = HOME_TEAM; } else { cur_team = visit; cur_match_index = VISITOR_TEAM; } for (i=0; i hi_scorer_goals) { hi_scorer_goals = match_goals[cur_match_index][j]; hi_scorer_index = j; hi_scorer_team = cur_match_index; } if (match_goals[cur_match_index][j] + match_assists[cur_match_index][j] >= hi_points) { if (match_goals[cur_match_index][j] + match_assists[cur_match_index][j] > hi_points) { hi_points = match_goals[cur_match_index][j] + match_assists[cur_match_index][j]; hi_points_index = j; hi_points_team = cur_match_index; } else if (match_goals[cur_match_index][j] > match_goals[hi_points_team][hi_points_index]){ // give preference to hi points with most goals hi_points = match_goals[cur_match_index][j] + match_assists[cur_match_index][j]; hi_points_index = j; hi_points_team = cur_match_index; } } } if (home_score >= visit_score) { cur_team = visit; cur_match_index = VISITOR_TEAM; } else { cur_team = home; cur_match_index = HOME_TEAM; } } // *************************** // fill in highlight structure // *************************** my_highlight -> home_score = home_score; my_highlight -> visit_score = visit_score; my_highlight -> periods = periods; for (i=0; i<4; i++) { my_highlight -> period_scores[HOME_TEAM][i] = goals_per_period[HOME_TEAM][i]; my_highlight -> period_scores[VISITOR_TEAM][i] = goals_per_period[VISITOR_TEAM][i]; } my_highlight -> highlight[0] = '\0'; gotit=0; if (hi_points == 0) { string_num = random(NUM_HL_ZERO_ZERO_STRINGS); sprintf(my_highlight -> highlight, hl_zero_zero_strings[string_num], get_player_fname(AWAY, get_team_ptr(AWAY) -> starting_goalie), get_player_lname(AWAY, get_team_ptr(AWAY) -> starting_goalie), get_player_fname(HOME, get_team_ptr(HOME) -> starting_goalie), get_player_lname(HOME, get_team_ptr(HOME) -> starting_goalie)); return; } // Is there a scorer with 3 or more goals? //TOM // hl_number=0; //END TOM if (hi_scorer_goals >= 3) { //TOM strcpy(my_highlight->ticker_hl_name[hl_number],get_player_lname(hi_scorer_team, hi_scorer_index)); my_highlight->ticker_hl_number[hl_number]=hi_scorer_goals; my_highlight->ticker_hl_type[hl_number]=GOAL_TYPE; hl_number++; //END TOM gotit=1; switch(string_num = random(NUM_HL_HI_SCORE_STRINGS)) { // Don't forget to add strings below too!!!!! case 0: case 1: case 3: case 5: case 6: case 8: sprintf(my_highlight -> highlight,hl_hi_score_strings[string_num], get_player_fname(hi_scorer_team, hi_scorer_index), get_player_lname(hi_scorer_team, hi_scorer_index), match_goals[hi_scorer_team][hi_scorer_index]); break; case 2: sprintf(my_highlight -> highlight,hl_hi_score_strings[string_num], get_modified_team_name(hi_scorer_team, temp_string), get_player_fname(hi_scorer_team, hi_scorer_index), get_player_lname(hi_scorer_team, hi_scorer_index), match_goals[hi_scorer_team][hi_scorer_index]); break; case 4: sprintf(my_highlight -> highlight,hl_hi_score_strings[string_num], get_player_fname(hi_scorer_team, hi_scorer_index), get_player_lname(hi_scorer_team, hi_scorer_index), get_modified_team_name(hi_scorer_team, temp_string), match_goals[hi_scorer_team][hi_scorer_index]); break; case 7: sprintf(my_highlight -> highlight,hl_hi_score_strings[string_num], get_player_fname(hi_scorer_team, hi_scorer_index), get_player_lname(hi_scorer_team, hi_scorer_index), // get_team_name(hi_scorer_team^1)); get_modified_team_name(hi_scorer_team^1,temp_string)); break; } //TOM // return; //END TOM } // Is there a shutout? if ((home_score == 0 && visit_score) || (visit_score == 0 && home_score)) { //TOM if(!gotit) //END TOM { gotit=1; switch(string_num = random(NUM_HL_SHUTOUT_STRINGS)) { case 0: sprintf(my_highlight -> highlight, hl_shutout_strings[string_num], get_player_fname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_player_lname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_modified_team_name(home_score == 0 ? HOME_TEAM : VISITOR_TEAM, temp_string)); break; case 1: sprintf(my_highlight -> highlight, hl_shutout_strings[string_num], get_player_fname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_player_lname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), match_goalie_shots_on[home_score == 0 ? VISITOR_TEAM : HOME_TEAM] [(int)get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie] ); break; case 2: sprintf(my_highlight -> highlight, hl_shutout_strings[string_num], get_player_fname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_player_lname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), // get_team_name(home_score == 0 ? HOME_TEAM : VISITOR_TEAM)); get_modified_team_name(home_score == 0 ? HOME_TEAM : VISITOR_TEAM,temp_string)); break; case 3: sprintf(my_highlight -> highlight, hl_shutout_strings[string_num], get_player_fname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_player_lname(home_score == 0 ? VISITOR_TEAM : HOME_TEAM, get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie), get_modified_team_name(home_score == 0 ? HOME_TEAM : VISITOR_TEAM, temp_string), match_goalie_shots_on[home_score == 0 ? VISITOR_TEAM : HOME_TEAM] [(int)get_team_ptr(home_score == 0 ? VISITOR_TEAM : HOME_TEAM) -> starting_goalie] ); break; } } //TOM // return; //END TOM } // Any player with 3 or more points? if (hi_points >= 3) { if (match_goals[hi_points_team][hi_points_index]) { //TOM strcpy(my_highlight->ticker_hl_name[hl_number],get_player_lname(hi_points_team, hi_points_index)); my_highlight->ticker_hl_number[hl_number]=(match_goals[hi_points_team][hi_points_index]<<4)+match_assists[hi_points_team][hi_points_index]; my_highlight->ticker_hl_type[hl_number]=GOAL_ASSIST_TYPE; hl_number++; if(!gotit) //END TOM { gotit=1; string_num = random(NUM_HL_MIXED_POINT_STRINGS); switch(string_num) { case 0: case 1: sprintf(my_highlight -> highlight, hl_mixed_point_strings[string_num], get_player_fname(hi_points_team, hi_points_index), get_player_lname(hi_points_team, hi_points_index), match_goals[hi_points_team][hi_points_index], match_assists[hi_points_team][hi_points_index]); break; case 2: sprintf(my_highlight -> highlight, hl_mixed_point_strings[string_num], get_player_fname(hi_points_team, hi_points_index), get_player_lname(hi_points_team, hi_points_index), match_goals[hi_points_team][hi_points_index]+ match_assists[hi_points_team][hi_points_index]); break; } } } else { //TOM strcpy(my_highlight->ticker_hl_name[hl_number],get_player_lname(hi_points_team, hi_points_index)); my_highlight->ticker_hl_number[hl_number]=match_assists[hi_points_team][hi_points_index]; my_highlight->ticker_hl_type[hl_number]=ASSIST_TYPE; hl_number++; if(!gotit) //END TOM { gotit=1; string_num = random(NUM_HL_ASSIST_STRINGS); sprintf(my_highlight -> highlight, hl_assist_strings[string_num], get_player_fname(hi_points_team, hi_points_index), get_player_lname(hi_points_team, hi_points_index), match_assists[hi_points_team][hi_points_index]); } } } //TOM // return; //END TOM // Goalie with >= 20 shots and <= 2 goals if (match_goalie_goals_against[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie] <= 2 && match_goalie_shots_on[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie] >= 20) { //TOM strcpy(my_highlight->ticker_hl_name[hl_number],get_player_lname(cur_match_index, get_team_ptr(cur_match_index) -> starting_goalie)); my_highlight->ticker_hl_number[hl_number]=match_goalie_shots_on[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie] - match_goalie_goals_against[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie], my_highlight->ticker_hl_type[hl_number]=SAVE_TYPE; hl_number++; if(!gotit) //END TOM { gotit=1; switch(string_num = random(NUM_HL_GOALIE_STRINGS)) { case 0: sprintf(my_highlight -> highlight, hl_goalie_strings[string_num], get_player_fname(cur_match_index, get_team_ptr(cur_match_index) -> starting_goalie), get_player_lname(cur_match_index, get_team_ptr(cur_match_index) -> starting_goalie), match_goalie_shots_on[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie] - match_goalie_goals_against[cur_match_index][(int)get_team_ptr(cur_match_index) -> starting_goalie], @ ¤ÿQš¶Ò‡ ÐLŠource\tfcore.c.f.8ŠQIsReadOnly()&^Šb$ Ø!NÛ!dÛ!zÛ!†Š¶ ’¶ne.šèÿx:\source\season.c¶Öôÿ ôÿ ÖHource\tfcore.côÿ ìÿx:\drv\parse.cæÿx:\source\tfcore.cøýu_long get_compressed_lengthchar *ebuf) {len, u_long *compressed_len) {nt attrib, MESSAGE *msg) {e *face, int buffer) {nfo *bsp, int vertex_base, Gfx **work, char flags, Vtx *vwork) {, char injuries_flag) {ewport, char transmode, short rotz, char frame) {